Ext.define('framenet.store.gridStore', {
    extend: 'Ext.data.JsonStore',
    
    constructor: function(cfg) {
        var me = this;
        cfg = cfg || {};
        me.callParent([Ext.apply({
        	model: Ext.create(cfg.model),
        	autoLoad: true,
        	proxy: {
        		type: 'ajax',
        		extraParams: {entity: cfg.entity},
        		api:{
        			read: 'read.htm',
        			update: 'update.htm',
        			create: 'create.htm',
        			destroy: 'delete.htm'
        		},
        		reader: {
        			type: 'json',
        			root: 'data',
        			successProperty: 'success'
        		}, 
        		writer: {
        			root: 'data',
        			encode: true,
        			allowSingle: false
        		}        		
        	}
        }, cfg)]);
    }
});
